package com.gitee.aurora.server.vo;

import lombok.Data;
import org.springframework.util.LinkedCaseInsensitiveMap;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * author: jiangfuxiao
 * Date:2022/9/24 16:42
 */
@Data
public class StDataResultVo {
    private List<LinkedHashMap<String, Object>> zfjdData ;
    private List<DataResultVo> sjzxData;
    private List<LinkedCaseInsensitiveMap<Object>> stSjzxData ;
    private Integer baqCount;
    private Integer sjzxCount;
    private Integer stSjzxCount;
    private Integer zfjdCount;




    public Integer getBaqCount(){
        AtomicInteger allAaqCount = new AtomicInteger(0);
        this.sjzxData.forEach(v -> {
            allAaqCount.set(allAaqCount.get()+v.getBaqCount());
        });
        this.baqCount = allAaqCount.get();
        return this.baqCount;
    }

    public Integer getSjzxCount(){
        AtomicInteger allSjzxCount = new AtomicInteger(0);
        this.sjzxData.forEach(v -> {
            allSjzxCount.set(allSjzxCount.get()+v.getSjzxCount());
        });
        this.baqCount = allSjzxCount.get();
        return this.baqCount;
    }

    public Integer getZfjdCount(){
        this.zfjdCount = this.zfjdData.size();
        return this.zfjdCount;
    }

    public Integer getStSjzxCount(){
        this.stSjzxCount = this.stSjzxData.size();
        return this.stSjzxCount;
    }

}
